package cn.yunhe.service.impl;

import cn.yunhe.dao.IPermissionDao;
import cn.yunhe.pojo.Permission;
import cn.yunhe.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class PermissionServiceImpl implements IPermissionService {

    @Autowired
    IPermissionDao permissionDao;

    public List<Permission> queryAll() {
        return permissionDao.queryAll();
    }

    public void insertPermission(Permission permission) {
        permission.setId(UUID.randomUUID().toString().replace("-", ""));
        permissionDao.insertPermission(permission);
    }

    public void deletePermissions(String[] ids) {
        permissionDao.deletePermissions(ids);
    }
}
